﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace server_daemon
{
    public class IntegerUtils
    {
        public class BooleanReturns
        {
            public static bool IsEven(int input)
            {
                //only works from 1-10
                if (input <= 10)
                {
                    switch (input)
                    {
                        case 0:
                            return true;
                        case 1:
                            return false;
                        case 2:
                            return true;
                        case 3:
                            return false;
                        case 4:
                            return true;
                        case 5:
                            return false;
                        case 6:
                            return true;
                        case 7:
                            return false;
                        case 8:
                            return true;
                        case 9:
                            return false;
                        case 10:
                            return true;
                    }
                }
                else
                {
                    throw (new Exception("Not smaller then or equal to 10"));
                }
                return false;
            }
            public static bool IsOdd(int input)
            {
                //only works from 1-10
                return false;
            }
        }

        public class IntegerReturns
        {
            public static int IsEven(int input)
            {
                //only works from 1-10
                //0 = true
                //1 = false
                if (input <= 10)
                {
                    switch (input)
                    {
                        case 0:
                            return 0;
                        case 1:
                            return 1;
                        case 2:
                            return 0;
                        case 3:
                            return 1;
                        case 4:
                            return 0;
                        case 5:
                            return 1;
                        case 6:
                            return 0;
                        case 7:
                            return 1;
                        case 8:
                            return 0;
                        case 9:
                            return 1;
                        case 10:
                            return 0;
                    }
                }
                else
                {
                    throw (new Exception("Not smaller then or equal to 10"));
                }
                return 1;
            }
        }
    }
}
